$(function(){
	var $lt = $("<table></table>");
	$lt.appendTo('body');
	$lt.datagrid({
		title:'籍贯列表',
		iconCls: 'icon-tip',
		fit:true,
		fitColumns:true,
		singleSelect:true,
		rownumbers:true,
		pagination:true,
		url:'list.shtml?tp=HOME',
	    columns:[[
	        {field:'tpCode',title:'编码',width:100,sort:true},
	        {field:'tpName',title:'名称',width:100}
	    ]],
	    toolbar:[{
			text:'新增',
			iconCls:'icon-add',
			handler:function(){parent.myDesk.csw({
				title : '新增籍贯',
				width : 300,
				height : 200,
				frameurl : 'settings/intonew.shtml?np=home'
			})}
		},{
			text:'编辑',
			iconCls:'icon-edit',
			handler:function(){alert('cut')}
		},'-',{
			text:'删除',
			iconCls:'icon-remove',
			handler:function(){alert('save')}
		}]
	});
	
	//设置分页控件
	var p = $lt.datagrid('getPager');  
    $(p).pagination({  
        pageSize: 10,//每页显示的记录条数，默认为10  
        pageList: [10,15,20],//可以设置每页记录条数的列表  
        beforePageText: '第',//页数文本框前显示的汉字  
        afterPageText: '页    共 {pages} 页',  
        displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录'
        /*onBeforeRefresh:function(){ 
            $(this).pagination('loading'); 
            alert('before refresh'); 
            $(this).pagination('loaded'); 
        }*/ 
    });  
});